/*
 * 中北大学软件学院版权所有2020-2025
 */
package nuc.lp.uolab.department.test;

import java.util.Scanner;

import nuc.lp.uolab.department.service.DeptService;
import nuc.lp.uolab.department.service.DeptServiceImpl;
import nuc.lp.uolab.department.vo.Major;

/**
 * 测试添加专业
 * @author liupeng
 * @version 1.0
 */
public class AddMajor {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入院系编号：");
		int did = scanner.nextInt();
		
		System.out.println("请输入专业名称");
		String majorName = scanner.next();
		
		System.out.println("输入备注");
		String remark = scanner.next();
		
		scanner.close();
		int majorId = (int)(Math.random() * 10000);
		Major major = new Major(majorId, majorName, did, remark);
		
		DeptService deptService = new DeptServiceImpl();
		int flag = deptService.addMajor(major);
		System.out.println(flag);
	}
}
